package com.example;

import java.util.stream.IntStream;

import org.eclipse.jdt.internal.compiler.batch.Main;

import io.reactivex.rxjava3.subjects.PublishSubject;

public class ClassesA {

    private static PublishSubject<AEvent> eventSubject = PublishSubject.<AEvent>create();


    public void test() {
        System.out.println("i am class A from bsp1");
    }

    public static void main(String[] args) {
        System.out.println(22);

        // 编译
        // Main.main(null);

        IntStream.range(1, 3).forEach(System.out::println);

        eventSubject.subscribe(aEvent -> System.out.println("class A received event: " + aEvent.getName()));
        eventSubject.onNext(new AEvent("123123"));
        eventSubject.onComplete();
    }


    public static class AEvent {

        private String name;


        public AEvent(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }


}
